﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ds.DataBase.Model;
using Ds.DataBase.Model.PersonalAssess;

namespace Ds.DataBase
{
    public class UserInfoClassContext : DbContext
    {
        public UserInfoClassContext() : base("schoolContext")
        {
              Database.Log = (log) => { System.Diagnostics.Debug.WriteLine(log); };
            //Database.SetInitializer<UserInfoClassContext>(null);
            //this.Configuration.LazyLoadingEnabled = false;

        }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // Database.SetInitializer<CmsDbContext>(null);
            //定义一对多的关系
            //modelBuilder.Entity<ZhiWei>().HasMany(c => c.JiaoZhiGongInfos)
            //    .WithRequired(a => a.zw);
            //modelBuilder.Entity<MyKaoHeBiao>().HasOptional(p => p.MyKaoHeBiaoOnes).WithMany().WillCascadeOnDelete(true);
            //modelBuilder.Entity<MyKaoHeBiao>().HasOptional(p => p.MyKaoHeBiaoFujiaxiangs).WithMany().WillCascadeOnDelete(true);
            //modelBuilder.Entity<MyKaoHeBiao_one>().HasOptional(p => p.MyKaoHeBiaoTwos).WithMany()
            //    .WillCascadeOnDelete(true);
            //modelBuilder.Entity<MyKaoHeBiao_two>().HasOptional(p => p.MyKaoHeBiaoTwoPingFens).WithMany()
            //    .WillCascadeOnDelete(true);
            //modelBuilder.Entity<ZhiWei>().HasRequired(c => c.keshi).WithMany(e => e.ZhiWeis);
            //modelBuilder.Entity<KeShi>().HasMany(c => c.ZhiWeis);
            base.OnModelCreating(modelBuilder);
        }
        public DbSet<Model.UserInfo> UserInfoContext { get; set; }
        public DbSet<Model.JiaoZhiGongInfo> JiaoZhiGongInfoContext { get; set; }
        public DbSet<ZhiWei> ZhiWeiContext { set; get; }
        public DbSet<KeShiZhiWu> KeShiZhiWuContext { set; get; }
        public virtual DbSet<PowerTree> PowerTreesContext { get; set; }
        public virtual DbSet<KeShi> KeShiContext { get; set; }
        public virtual DbSet<MoBan> MoBanContext { get; set; }
        public virtual DbSet<NeiRong> NeiRongContext { set; get; }
        public virtual DbSet<GongZuoJiHua> GongZuoJiHuaContext { set; get; }
        public virtual DbSet<JiXiao> JiXiaoContext { set; get; }
        public virtual DbSet<MyKaoHeBiao> MyKaoHeBiaoContext { set; get; }
        public virtual  DbSet<zongjieone> ZongJieContext { set; get; }
        //public virtual DbSet<MyKaoHeBiao_one> MyKaoHeBiaoOnesContext { set; get; }
        //public virtual DbSet<MyKaoHeBiao_two> MyKaoHeBiaoTwosContext { set; get; }
        //public virtual DbSet<MyKaoHeBiao_twoPingFen> MyKaoHeBiaoTwoPingFensContext { set; get; }
        //public virtual DbSet<MyKaoHeBiao_fujiaxiang> MyKaoHeBiaoFujiaxiangsContext { set; get; }
        public virtual DbSet<KaoHeBiaoRiZhi> KaoHeBiaoRiZhiContext { set; get; }
        public virtual DbSet<KaoHeFanWei> KaoHeFanWeisContext { set; get; }
        public virtual DbSet<KaoHeFanWei_RenYuan> KaoHeFanWeiRenYuansContext { set; get; }
        public virtual DbSet<KaoHeDeFenHuiZong> KaoHeDeFenHuiZongContext { set; get; }
        public virtual DbSet<FuJiaXiang> FuJiaXiangContext { set; get; }
        //public virtual DbSet<zongjieone> zongjieoneContext { set; get; }
        public virtual DbSet<zongjietwo> zongjietwoContext { set; get; }
        public virtual DbSet<xiangguangongzuo> xiangguangongzuoContext { set; get; }
        public virtual DbSet<MoBan_Main> Moban_MainContext { set; get; }
        public virtual DbSet<MoBan_Path> MoBan_PathContext { set; get; }
        public virtual DbSet<MoBan_Control> MoBan_ControlContext { set; get; }
        public virtual DbSet<PersonalMain> PersonalMainContext { set; get; }
    }
}
